//
//  JoinUsPublishMessageVC.swift
//  甜言蜜语
//
//  Created by yingli_yanfa_liuxingyu on 16/7/31.
//  Copyright © 2016年 wl. All rights reserved.
//

import UIKit

class JoinUsPublishMessageVC: UIViewController {
    @IBOutlet weak var headerView: UIView!
    @IBOutlet weak var jobWantView: UIView!
    @IBOutlet weak var advertisesView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.jobWantView.backgroundColor = UIColor.colorWithRGB(211, g: 213, b: 213)

        
    }

   
    @IBAction func jobWant(sender: UITapGestureRecognizer) {
        if !ApplicationDelegate.isLogin(){
            let sb = UIStoryboard(name: "Login", bundle: nil)
            let vc = sb.instantiateViewControllerWithIdentifier("LoginViewController")
            self.navigationController?.pushViewController(vc, animated: true)
            
        }else{
            self.jobWantView.backgroundColor = UIColor.colorWithRGB(211, g: 213, b: 213)
            self.advertisesView.backgroundColor = UIColor.whiteColor()
            
            if !publicMethod.isComplete(){
                let sb = UIStoryboard.init(name: "Login", bundle: nil)
                let vc = sb.instantiateViewControllerWithIdentifier("ChooseTypeTableViewController") as! ChooseTypeTableViewController
                
                self.navigationController?.pushViewController(vc, animated: true)
            }else{
                let type = (NSUserDefaults.standardUserDefaults().objectForKey("k_UD_type")) as! String
                
                if type == "个人"{
                    let vc = self.storyboard?.instantiateViewControllerWithIdentifier("PublishWantJobMessageTC") as! PublishWantJobMessageTC
                    self.navigationController?.pushViewController(vc, animated: true)
                }else{
                    let alertView = UIAlertView(title: "提示", message: "您所注册的会员类别不能发布求职信息", delegate: nil, cancelButtonTitle: "确定" )
                    
                    alertView.show()
                    
                }
                
            }
        }
        
    }
    
    @IBAction func advertises(sender: UITapGestureRecognizer) {
        if !ApplicationDelegate.isLogin(){
            let sb = UIStoryboard(name: "Login", bundle: nil)
            let vc = sb.instantiateViewControllerWithIdentifier("LoginViewController")
            self.navigationController?.pushViewController(vc, animated: true)
            
        }else{
            self.advertisesView.backgroundColor = UIColor.colorWithRGB(211, g: 213, b: 213)
            self.jobWantView.backgroundColor = UIColor.whiteColor()
            if !publicMethod.isComplete(){
                let sb = UIStoryboard.init(name: "Login", bundle: nil)
                let vc = sb.instantiateViewControllerWithIdentifier("ChooseTypeTableViewController") as! ChooseTypeTableViewController
                
                self.navigationController?.pushViewController(vc, animated: true)
            }else{
                let type = (NSUserDefaults.standardUserDefaults().objectForKey("k_UD_type")) as! String
                
                if type == "个人"{
                    let alertView = UIAlertView(title: "提示", message: "您不能发布招聘信息", delegate: nil, cancelButtonTitle: "确定" )
                    
                    alertView.show()
                }else{
                    
                    let vc = self.storyboard?.instantiateViewControllerWithIdentifier("PublishRectquirMessageTC") as! PublishRectquirMessageTC
                    self.navigationController?.pushViewController(vc, animated: true)
                    
                }
                
            }
        }
        
        
    }
    
}
